package com.zhi.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.zhi.entity.Dictionary;

public interface DictionaryRepository extends JpaRepository<Dictionary, Integer>{
	
	@Query("SELECT dict FROM Dictionary dict WHERE codeType = ?1")
	public List<Dictionary> getDictsByCodeType(String codeType);

	/**
	 * 通过codeType与code查询Dictionary集合，正常数据仅返回1个对象
	 * 此种用法注意方法名：findByXXXX1AndXXX2(XXXX1,XXXX2)
	 * @param codeType
	 * @param code
	 * @return
	 */
	public List<Dictionary> findByCodeTypeAndCode(String codeType,String code);

}
